//
//  UserManaged.swift
//  Swift_SendMessage
//
//  Created by lanou3g on 15/11/25.
//  Copyright © 2015年 笨蛋一号后卫. All rights reserved.
//

import UIKit

class UserManaged: NSObject {
    //定义两个私有属性
    private var userName : String?
    private var userID : String?
    //定义一个私有的类属性
    private static var user : UserManaged?
    //Swift 中最简单也是最常用的一个单例
    static func defaultManager() -> UserManaged {
        if user == nil {
        user = UserManaged()
        }
        return user!
    }
    //
    func saveUser(userName : String, userID : String) {
        self.userName = userName
        self.userID = userID
    }
    
    func findUserSince() -> (String, String) {
        return (self.userName!, self.userID!)
    }
    
    
}
